/*
 * @Description: vite配置文件
 * @Author: chenjiaxin
 * @Date: 2024-11-05 10:17:45
 * @LastEditTime: 2024-12-03 11:38:38
 */
import { defineConfig } from "vite";

import react from "@vitejs/plugin-react";

import tailwindcss from "tailwindcss";

// import legacy from "@vitejs/plugin-legacy";

const { distDir, open, sourceDir } = require("./app.config");

export default defineConfig({
  base: "./",
  plugins: [
    react(),
    // legacy({
    //   targets: ["defaults", "not IE 11"],
    // }),
  ],
  css: {
    postcss: {
      plugins: [require("postcss-preset-env"), tailwindcss],
    },
  },
  server: {
    open,
  },
  build: {
    outDir: distDir,
    rollupOptions: {
      output: {},
    },
  },
  resolve: {
    alias: {
      "@": sourceDir,
    },
  },
});
